package com.furongji.education.clients;

import com.furongji.common.domain.query.CourseQuery;
import com.furongji.common.domain.vo.CourseOrderVo;
import com.furongji.common.domain.vo.CourseViewCountVo;
import com.furongji.common.domain.vo.VideoPlayPageVo;
import com.furongji.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "course-service", contextId = "CourseFeignClient")
public interface CourseFeignClient {

    @PostMapping("/admin/courses/pageQuery/{current}/{size}")
    public Result pageCourseQuery(@PathVariable Integer current,
                                  @PathVariable Integer size,
                                  @RequestBody(required = false) CourseQuery courseQuery);

    @GetMapping("/api/courses/getCourseInfoByTeacherId/{teacherId}")
    public Result getCourseInfoByTeacherId(@PathVariable String teacherId);

    @GetMapping("/api/courses/getCourserOrderInfo/{courserId}")
    public CourseOrderVo getCourserOrderInfo(@PathVariable String courserId);

    @GetMapping("/api/courses/getCourseInfoWithSections/{videoId}")
    public VideoPlayPageVo getCourseInfoWithSections(@PathVariable String videoId);

    @PutMapping("/admin/courses/buyCourseCount/{courseId}")
    public Result buyCourseCount(@PathVariable String courseId);

    // 统计新增课程数
    @GetMapping("/admin/courses/courseInsertCount/{date}")
    public Integer courseInsertCount(@PathVariable String date);

    // 统计每种课程浏览量
    @Operation(summary = "统计课程浏览数量")
    @GetMapping("/admin/courses/courseViewCount/{date}")
    public List<CourseViewCountVo> courseViewCount(@PathVariable String date);
}
